import ReactDOM from "react-dom/client";
import "reset-css";
import "@/assets/styles/global.scss";
import { ConfigProvider } from "antd";
import zh from "antd/es/locale/zh_CN"; // 中文
import en from "antd/es/locale/en_GB"; // 英文
import { I18nextProvider } from "react-i18next";
import { i18n } from "./i18n/index.js";
import App from "./App.jsx";

import { BrowserRouter } from "react-router-dom";
import { getLang } from "@/utils/index";
// 状态管理
//import { Provider } from "react-redux";
// import store from '@/store'
const getLocale = (globalLanguage: any) => {
  switch (globalLanguage) {
    case "zh":
      return zh;
    case "en":
      return en;
  }
};
ReactDOM.createRoot(document.getElementById("root")!).render(
  <I18nextProvider i18n={i18n}>
    <ConfigProvider locale={getLocale(getLang())}>
      <BrowserRouter>
        <App />
      </BrowserRouter>
    </ConfigProvider>
  </I18nextProvider>
);
